cc.Class({
    extends: cc.Component,

    properties: {
       txtPhase: cc.Label,
       txtTime: cc.Label,
       txtBet: cc.Label,
       txtWin: cc.Label,
       btnDetail: cc.Button
    },

    onLoad () {
        this.data = null;
        this.btnDetail.node.on('click', () => this.node.emit('click', this.data), this);
    },

    init(data) {
        this.data = data;
        this.txtPhase.string = data.phase.substr(4, data.phase.length - 4);
        this.txtTime.string = data.createTime.substr(5, data.createTime.length - 8);
        this.txtBet.string = data.amount;
        this.txtWin.string = data.returnAmount;
    }

});
